<?php
/**
 * Created by PhpStorm.
 * User: tri
 * Date: 7/31/2014
 * Time: 1:33 PM
 */

require_once('../../class_ajax_request/classAjax.php');
include_once('../../application/functions.php');
include_once('../../application/DataConfig.php');

$idPost = $key['id'];
$obj      = new AjaxRequest();

$voters = $obj->getVoter($idPost);
//echo '<pre>';
//print_r($voters);
//echo '</pre>';
echo '<ul class="voter-list">';
foreach($voters as $voter){

    $avatar = $voter['user_avatar'];
    $avatar = _Function::checkExistsAvatar($avatar,'48-48');
    //echo $avatar;

    $userLink = URL_BASE.$key['username'];
    echo '<li>';
    echo '<span class="paddingPost">
        <a href="'.$userLink.'" data-id="11" class="openModal" style="float:left; width:10%">
         			<img class="avatar_user" src="'.$avatar.'">
        </a>
        <span class="detail_grid" style="
    width: 89%;
    margin-top: 10px;
">
        <a href="'.$userLink.'"><span class="timestamp timeAgo">'.$voter['user_real_name'].'</span></a>
        <a href="'.$userLink.'"><p>'.$voter['user_name'].'</p></a>
    </span>
    </span>';
    echo '</li>';
}
echo '</ul>';